﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace AmiBrokerPlugin
{
    public class StockInfo
    {
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)]
        public string ShortName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)]
        public string AliasName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)]
        public string WebID;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
        public string FullName;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
        public string Address;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
        public string Country;
        /// <summary>
        /// ISO 3 letter currency code
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
        public string Currency;
        /// <summary>
        /// The ID of the data plug-in, 0 - accept workspace settings
        /// </summary>
        public int DataSource;
        /// <summary>
        /// Local mode of operation - 0 - accept workspace settings, 1 - store locally, 2 - don't store locally
        /// </summary>
        public int DataLocalMode;
        public int MarketID;
        public int GroupID;
        public int IndustryID;
        public int GICS;
        /// <summary>
        /// continuous etc.
        /// </summary>
        public int Flags;
        public int MoreFlags;
        /// <summary>
        /// new futures fields - active if SI_MOREFLAGS_FUTURES is set
        /// </summary>
        public float MarginDeposit;
        public float PointValue;
        public float RoundLotSize;
        /// <summary>
        /// New futures fields - active if SI_MOREFLAGS_FUTURES is set
        /// </summary>
        public float TickSize;
        /// <summary>
        /// Number of decimal places to display
        /// </summary>
        public int Decimals;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
        public short[] LastSplitFactor;
        public UInt64 LastSplitDate;
        public UInt64 DividendPayDate;
        public UInt64 ExDividendDate;
        public float SharesFloat;
        public float SharesOut;
        public float DividendPerShare;
        public float BookValuePerShare;
        public float PEGRatio;
        public float ProfitMargin;
        public float OperatingMargin;
        public float OneYearTargetPrice;
        public float ReturnOnAssets;
        public float ReturnOnEquity;
        public float QtrlyRevenueGrowth;
        public float GrossProfitPerShare;
        public float SalesPerShare;
        public float EBITDAPerShare;
        public float QtrlyEarningsGrowth;
        public float InsiderHoldPercent;
        public float InstitutionHoldPercent;
        public float SharesShort;
        public float SharesShortPrevMonth;
        public float ForwardEPS;
        public float EPS;
        public float EPSEstCurrentYear;
        public float EPSEstNextYear;
        public float EPSEstNextQuarter;
        public float ForwardDividendPerShare;
        public float Beta;
        public float OperatingCashFlow;
        public float LeveredFreeCashFlow;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
        public float[] ReservedInternal;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
        public float[] UserData;
    }
}
